/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddDealCategory;
/*     */ import com.newcrm.webapi.sub.DeleteDealCategory;
/*     */ import com.newcrm.webapi.sub.ListDealCategory;
/*     */ import com.newcrm.webapi.sub.UpdateDealCategory;
/*     */ import com.newcrm.webapi.sub.UpdateDealCatogorySort;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class DealCategory extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = -7782130824884265691L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  47 */     if (!checkLogin(request)) {
/*  48 */       super.showLoginPage(request, response);
/*  49 */       return;
/*     */     }
/*     */ 
/*  53 */     if (!super.getLoginUser(request).isAdmin) {
/*  54 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  55 */         request, response);
/*  56 */       return;
/*     */     }
/*     */ 
/*  59 */     String url = request.getRequestURI();
/*  60 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  62 */       if ((param == null) || (param.length == 0)) {
/*  63 */         String operation = Util.getURLParameter(request
/*  64 */           .getParameter("operation"));
/*  65 */         if ((operation == null) || (operation.trim().length() == 0)) {
/*  66 */           new ListDealCategory(this).parse(request, response);
/*  67 */           return;
/*     */         }
/*     */ 
/*  70 */         if ("sort".equals(operation)) {
/*  71 */           new UpdateDealCatogorySort(this).parse(request, response);
/*  72 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/*  76 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/*  77 */         response);
/*  78 */       return;
/*     */     }
/*     */ 
/*  81 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/*  86 */     return new AddDealCategory(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/*  91 */     return new DeleteDealCategory(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/*  96 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 101 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 106 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 111 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 116 */     return null;
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 121 */     return "/dealcategory";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 126 */     return new UpdateDealCategory(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.DealCategory
 * JD-Core Version:    0.6.1
 */